s = {1,25,'jay',10.3}
print(s, type(s))
#
# s = set()  # 创建了一个空集合，的布尔值是false
# print(s, type(s))
#
# s={}
# print(s, type(s))  # 创建的是字典
#
# s = set('helloworld')
# print(s)
#
# s3 = set([10,20,30])
# print(s3)
#
# print(len(s3))
# print(max(s3))
# print(min(s3))
#
# print(10 in s3)
# print(11 not in s3)
#
# del s3
# print(s3)

# 集合的操作符
A = {10,20,30,40,50}
B = {30,50,88,76,20}
print(A&B)
print(A|B)
print(A-B)
print(A^B)
#
# # 集合的相关操作
# A.add(100)
# print(A)
#
# A.remove(100)
# print(A)
#
# A.clear()
# print(A)

# 遍历
for item in A:
    print(item)

for index, item in enumerate(A):
    print(index, '->', item)

# 集合的生成式
s = {i for i in range(1, 10)}
print(s)

s = {i for i in range(1, 10) if i % 2 == 1}
print(s)


